package com.company.factory.simple;

import com.company.factory.simple.impl.Tesla;
import com.company.factory.simple.impl.WuLin;

public class Consumer {
    public static void main(String[] args) {
//      接口，手动创建
//      Car car1=new WuLin();
//      Car car2=new Tesla();
//      2，使用工厂创建
//        Car car1 = CarFactory.getCar("五菱");
//        Car car2 = CarFactory.getCar("特斯拉");
//        3.使用属性创建
        Car car1 = CarFactory.getCarByBrand("WuLin");
        Car car2 = CarFactory.getCarByBrand("Tesla");
        car1.name();
        car2.name();
    }
}
